-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy: support dynamic port number #289
base: master
Are you sure you want to change the base?
Conversation
a3540f4
to
5e57aea
Compare
Will this be merged, or will other plans be considered for dynamic ports? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, been super busy... I haven't tested this myself but I trust you have? I just have one request for a comment, as I'm not sure if that new exported function is necessary.
modules/l4proxy/upstream.go
Outdated
@@ -30,12 +30,23 @@ import ( | |||
"github.com/mholt/caddy-l4/layer4" | |||
) | |||
|
|||
func ParseAddress(addr string) (*caddy.NetworkAddress, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a godoc to this? to explain why it is needed? (I'm not entirely sure myself, just by looking at it, since it uses only exported methods)
5e57aea
to
506e9bd
Compare
This was my mistake about the exported function, it's not used outside and is unlikely to be used outside. I have been using it and it is working fine for two weeks. For a simple test, use the following config:
|
This PR delays address parsing in some case to make dynamic port numbers work properly.
If dial addresses contains
{
and}
, address parsing inUpstream.provision
will be skipped then done later inHandler.dialPeers
after all placeholders are replaced, and active health checks will be ignored.Example Caddyfile: